﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MemberSearch.aspx.cs" Inherits="MemberMgr.Website.Member.MemberSearch" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="zh-CN" />
    <ext:Viewport runat="server" Layout="border">
        <Items>
            <ext:FormPanel runat="server" Region="North" Title="查询条件" Padding="5" Height="100"
                Frame="true" Margins="5 5 5 5" Layout="Table" Icon="Magnifier">
                <Items>
                    <ext:TableLayout ID="tblLayout" runat="server" Columns="4" LabelWidth="70" LabelAlign="Right">
                        <Cells>
                            <ext:Cell ColSpan="2">
                                <ext:TextField ID="txtSearchName" runat="server" Text="" FieldLabel="会员名称">
                                </ext:TextField>
                            </ext:Cell>
                            <ext:Cell ColSpan="2">
                                <ext:TextField ID="txtSearchNo" runat="server" Text="" FieldLabel="会员编号">
                                </ext:TextField>
                            </ext:Cell>
                        </Cells>
                    </ext:TableLayout>
                </Items>
                <Buttons>
                    <ext:Button ID="btnSearch" Type="Button" runat="server" Text=" 查 询 ">
                        <DirectEvents>
                            <Click OnEvent="btnSearch_Click" DisableCaching="true">
                                <EventMask ShowMask="true" Msg="正在查询，请稍后..." />
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
            <ext:GridPanel ID="gpMemberInfo" runat="server" Title="会员列表" Margins="0 0 5 5" Icon="UserSuit"
                Region="Center" AutoExpandColumn="Address" Frame="true">
                <Store>
                    <ext:Store ID="storeMemberList" runat="server" OnRefreshData="storeMemberList_Refresh">
                        <Reader>
                            <ext:JsonReader IDProperty="ID">
                                <Fields>
                                    <ext:RecordField Name="MEMBERNAME" />
                                    <ext:RecordField Name="MEMBERNO" />
                                    <ext:RecordField Name="MEMBERTEL" />
                                    <ext:RecordField Name="MEMBERADDRESS" />
                                    <ext:RecordField Name="MEMBERTYPE" />
                                    <ext:RecordField Name="MEMBERCARD" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:Column DataIndex="MEMBERNO" Header="会员编号" Width="60" />
                        <ext:Column DataIndex="MEMBERNAME" Header="会员名称" Width="100" />
                        <ext:Column DataIndex="MEMBERTEL" Header="电话" Width="60" />
                        <ext:Column ColumnID="Address" DataIndex="MEMBERADDRESS" Header="地址" />
                        <ext:Column DataIndex="MEMBERTYPE" Header="会员类型" Width="60" />
                        <ext:Column DataIndex="MEMBERCARD" Header="会员卡号" Width="60" />
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="rowSelModelMember" runat="server" SingleSelect="true">
                        <DirectEvents>
                            <RowSelect OnEvent="RowSelect" Buffer="100">
                                <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{fpMemberDetail}" />
                                <ExtraParams>
                                    <ext:Parameter Name="memberID" Value="this.getSelected().id" Mode="Raw" />
                                </ExtraParams>
                            </RowSelect>
                        </DirectEvents>
                    </ext:RowSelectionModel>
                </SelectionModel>
                <BottomBar>
                    <ext:PagingToolbar ID="PagingToolbar1" runat="server" />
                </BottomBar>
                <LoadMask ShowMask="true" />
            </ext:GridPanel>
            <ext:FormPanel ID="fpMemberDetail" runat="server" Region="East" Split="true" Margins="0 5 5 5"
                Frame="true" Title="会员详细信息" Width="280" Icon="User" DefaultAnchor="100%">
                <Items>
                    <ext:Hidden ID="txtMemberID" runat="server" DataIndex="Id" />
                    <ext:TextField ID="txtMemberNo" runat="server" FieldLabel="会员编号" DataIndex="Memberno" />
                    <ext:TextField ID="txtMemberName" runat="server" FieldLabel="会员名称" DataIndex="Membername" />
                    <ext:TextField ID="txtMemberTel" runat="server" FieldLabel="电话" DataIndex="Membertel" />
                    <ext:TextField ID="txtMemberAddress" runat="server" FieldLabel="地址" DataIndex="Memberaddress" />
                    <ext:TextField ID="txtMemberType" runat="server" FieldLabel="会员类型" DataIndex="Membertype" />
                    <ext:TextField ID="txtMemberCardNo" runat="server" FieldLabel="会员卡号" DataIndex="Membercard" />
                </Items>
                <Buttons>
                    <ext:Button ID="btnAdd" runat="server" Type="Button" Text="添加会员信息" Icon="UserAdd" OnClientClick="#{fpMemberDetail}.getForm().reset()">
                    </ext:Button>
                    <ext:Button ID="btnDelete" runat="server" Type="Button" Text="删除会员" Icon="UserDelete">
                        <DirectEvents>
                            <Click OnEvent="btnDelete_Click" >
                                <Confirmation Message="确定删除当前会员吗?" ConfirmRequest="true"  />
                                <EventMask ShowMask="true" Msg="正在删除,请稍后..." />
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                    <ext:Button ID="btnSave" runat="server" Type="Button" Text=" 保 存 " Icon="DatabaseSave">
                        <DirectEvents>
                            <Click OnEvent="btnSave_Click" DisableCaching="true">
                                <EventMask ShowMask="true" Msg="正在保存，请稍后..." />
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
